package com.zkadmin.renderer;

import org.zkoss.zul.Hbox;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.Treecell;
import org.zkoss.zul.Treerow;

public abstract class BaseRenderer {
	protected Listcell createListcell(Listitem listitem) {
		Listcell listcell = new Listcell();
		listitem.appendChild(listcell);
		return listcell;
	}

	protected Treecell createTreecell(Treerow treerow) {
		Treecell treecell = new Treecell();
		treerow.appendChild(treecell);
		return treecell;
	}

	protected Hbox createHbox(Listitem listitem) {
		Hbox hbox = new Hbox();
		hbox.setWidth("100%");
		//hbox.setPack("center");
		createListcell(listitem).appendChild(hbox);
		return hbox;
	}

	protected Hbox createHbox(Treerow treerow) {
		Hbox hbox = new Hbox();
		hbox.setWidth("100%");
		//hbox.setPack("center");
		createTreecell(treerow).appendChild(hbox);
		return hbox;
	}
}
